package com.example.springdate.dto;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.springdate.domain.Users;
@Service
public class UserService {
	@Autowired
    UserDao userDao;//注入UserRepository
 
	public void save(Users user){
		userDao.save(user);
	}
	
	public Users getByid(String id){
		return userDao.findOne(id);
	}
	
	public Users getByid1(String id){
		return userDao.getByid(id);
	}
	
	public Users getByid2(String id){
		return userDao.getByprimarykey(id);
	}
	
	public void update1(String username,String id){
		userDao.updateByid(id, username);
	}
	public void update2(Users user){
		userDao.save(user);
	}
	


}
